Untitled Game-Like Application (UGLA)
I play video games from time to time and I'm obsessed with world interactivity as a major game mechanic. Drawing inspiration from the interactivity of games like Breath of the Wild and the voxel style of Terraria, I wrote a proof of concept game my freshman year at Tufts where the primary mechanic is manipulating the ground to navigate and attack an enemy.
Though it's not a full-fledged game, I refined much of my understanding of OOP by writing everything but the graphics library from scratch, all in C++. The graphics library I used was SFML which I chose because it gave me super simply graphics drawing facilities. I wanted to set myself up to write things from the ground up because I think that's where the most learning can happen. I definitely prioritized learning over making something long-standing and maintainable!
This involved approach led me to explore how to create an entity management system, optimize collision solving, create sprite animations, writing a physics engine, and more.
I was particularly proud of the collision solver and voxel physics system. It was tricky to get collisions to work out consistently because each voxel needed to be considered when moving the player out of the ground. Since the player could be moving quite fast and the voxels are small, it was possible to intersect upwards of 8 voxels at a time. Finding a good solution that moves the player out of all of those voxels without teleporting them to an illogical location turned out to be really hard! I ended up with a solution that only checks very close tiles for collisions - this was a massive optimization - and moves the player the shortest distance possible that will remove them from the intersection. It does this one by one for each tile they're colliding with and in most cases it works great!
After all of this, the main gameplay mechanic was "bending" tiles. It lets the player launch tiles away from them, use tiles below them to jump, and create a ground ripple effect by "ground pounding". Entities take damage and are sent flying when ground tiles are launched at them, and once tiles fall to the ground they become apart of the world again. Gameplay is snappy and I've spent tons of time just messing with the mechanics to see what the player can do.
Along with some rendering optimizations (to only draw things that are actually on the screen, and such) this system allows for upwards of 100,000 voxels to be placed in the world with not a lot of CPU usage. The main limitation to world size is memory since each voxel is an object and currently doesn't get unloaded at any point. It would be cool to have a chunk loading/unloading system that saved voxel information to disk and unloaded them from memory when they got far enough away.
There are a handful of other features I worked on including a procedurally generated world where tiles are textured with perlin noise, and different tile materials. Sand will shuffle down diagonally if possible to create mounds, and water will flow horizontally. The player can also swim through water tiles. Oh to be an earthbending beachgoer.
I don't see myself as a game developer but this project taught me countless lessons of optimization, writing clean code, user interaction, and the importance of building things you really enjoy. Check out the code and binary here.
signpost care to venture further?
Side Projects
tylerthompson.work - the website you're currently looking at